local skill = fk.CreateSkill{
  name = "tea__zhujing_zhuwo_active",
}
local U = require "packages/utility/utility"
---@class ViewAsSkill
---@field expand_pile integer[]
---@type ViewAsSkillSpec
local zhujing_zhuwo_active = {
  name = "tea__zhujing_zhuwo_active",
  mute = true,
  interaction = function(self, player)
    local all_names = Fk:getAllCardNames("t")
    all_names = table.filter(all_names, function(n)
      return not Fk:cloneCard(n).is_damage_card
    end)
    local names = player:getViewAsCardNames("tea__zhujing_active", all_names, player:getCardIds("h"))
    if #names > 0 then
      return UI.CardNameBox { choices = names, all_choices = all_names }
    end
  end,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeBasic and table.contains(self.expand_pile, to_select)
  end,
  view_as = function(self, player, cards)
    if not self.interaction.data or #cards ~= 1 then return end
    local card = Fk:cloneCard(self.interaction.data)
    card.skillName = "tea__zhuwo"
    return card
  end,
}
skill:addEffect("viewas", zhujing_zhuwo_active)
return skill